<template>
  <div>
    <BasicDrawer :title="operationName" showFooter v-bind="$attrs" width="90%" @close="handleClose"
                 @ok="handleSubmit" @back="goBack"  :isDetail="true"
                 @register="registerDrawer">
<!--      <BasicForm @register="registerForm"/>-->
    </BasicDrawer>
  </div>
</template>
<script lang="ts" setup>
import {useDrawerInner} from '#/components/Drawer';
//import {useMessage} from '#/components/utils/hooks/web/useMessage';
import { nextTick,defineEmits, defineOptions,ref, unref } from 'vue';
// import { BasicForm, FormSchema, useForm , FormActionType, FormProps } from '#/components/Form';
import { useRoute } from 'vue-router';
// import { useGo } from '#/components/utils/hooks/web/usePage';
//import { useTabs } from '#/components/utils/hooks/web/useTabs';
import { Tabs } from 'ant-design-vue';

defineOptions({ name: 'ProjectAddOrEdit' });

const emit = defineEmits(['success', 'register']);
const operationType = ref("");
const operationName = ref("");
const go = useGo();
const currentKey = ref('detail');
const ATabs = Tabs;
const ATabPane = Tabs.TabPane;
const route = useRoute();
const userId = ref(route.params?.id);

//const [registerForm, {validateFields, clearValidate, getFieldsValue, resetFields, setFieldsValue,setProps}] =


const [registerDrawer, {setDrawerProps, closeDrawer}] = useDrawerInner(async (data) => {
  setDrawerProps({confirmLoading: false});
  operationType.value = data.operationType;
  operationName.value = data.operationName;
  if (unref(operationType) != 'add') {
  }

});

async function handleSubmit(values: any) {
}

function handleClose(values: any) {
  console.log('handleClose');

}
// async function setProps(props: FormProps) {
//   const formEl = unref(formElRef);
//   // console.info(formEl);
//   // if (!formEl) return;
//   // await nextTick();
//   // await formEl.setProps(props);
//   setProps.
// }
// 页面左侧点击返回链接时的操作
function goBack() {
  // 本例的效果时点击返回始终跳转到账号列表页，实际应用时可返回上一页
 // go('/project/list');
}
</script>
